package com.titar.robot.entity;

import com.google.gson.annotations.SerializedName;

import org.jetbrains.annotations.NotNull;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(
        tableName = "cache_data_table"
)
public class CacheTableData {
    @SerializedName("key")
    @ColumnInfo(name = "key")
    @PrimaryKey
    @NotNull
    String key;

    @SerializedName("value")
    @ColumnInfo(name = "value")
    String value;

    @SerializedName("update_time")
    @ColumnInfo(name = "update_time")
    long update_time = 0;

    @SerializedName("valid_time")
    @ColumnInfo(name = "valid_time")
    long valid_time = 0;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public long getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(long update_time) {
        this.update_time = update_time;
    }

    public long getValid_time() {
        return valid_time;
    }

    public void setValid_time(long valid_time) {
        this.valid_time = valid_time;
    }

    @Override
    public String toString() {
        return "CacheTableData{" +
                "key='" + key + '\'' +
                ", value='" + value + '\'' +
                ", update_time=" + update_time +
                ", valid_time=" + valid_time +
                '}';
    }
}
